import { IQuestionForm, AddUserFrom } from '@/utils/interface';
import { request } from 'umi';

// 获取试题列表
export function getQuestionType() {
  return request('/exam/getQuestionsType');
}
//获取所有的试题
export function getExamText() {
  return request('/exam/questions/new');
}
// 获取所有课程
export function getExamSubject() {
  return request('/exam/subject');
}

// 获取所有考试类型
export function getExamType() {
  return request('/exam/examType');
}
// 添加试题
export function submitQuestion(data: IQuestionForm) {
  return request('/exam/questions', {
    method: 'POST',
    data,
  });
}

//添加用户
export function addUser(user_name: any, user_pwd: any) {
  return request('/user', {
    method: 'POST',
  });
}

//展示用户数据
export function userData() {
  return request('/user/user');
}
//展示身份数据
export function userAdmin() {
  return request('/user/identity');
}
//展示api接口权限
export function getApi() {
  return request('/user/api_authority');
}
//展示身份和api权限关系
export function getIdapi() {
  return request('/user/identity_api_authority_relation');
}
//获取视图权限数据
export function getView() {
  return request('/user/view_authority');
}
//身份和视图权限关系
export function getViewApi() {
  return request('/user/identity_view_authority_relation');
}
//考试管理  试卷列表
export function getExamShilist() {
  return request('/exam/exam');
}
//班级管理
export function getClassGuanLi() {
  return request('/manger/grade');
}
//教室管理
export function getClassRooManaGement() {
  return request('/manger/room');
}
